package main

import "fmt"

func main() {
	strs := []string{"1", "2", "3"}
	fmt.Printf(" a : %v  len : %d  cap : %d \n", strs, len(strs), cap(strs))

	strs2 := nonempty(strs)
	fmt.Printf(" a : %v  len : %d  cap : %d \n", strs2, len(strs2), cap(strs2))
}

func nonempty(strs []string) []string {
	i := 0
	for _, s := range strs {
		if s != "" {
			strs[i] = s
			i++
		}
	}
	return strs[:i]
}
